package uk.co.lunagroup.files;

import java.io.File;

/**
 * . class Directory is holding the set of values (all File typype)
 * 
 * @author robert.kowalski
 * 
 */
public class Directory {
	private File[] directory;

	// constructors
	public Directory(final File[] files) {
		// super(files[0], ""); if want to use this class as extend to File
		// class
		this.directory = files;
	}

	public Directory(final Directory dir) {
		this.directory = dir.getDirectory();
	}

	public Directory(final File file) {
		this(new File[] { file });
	}

	public Directory(final String directoryPath) {
		this(new File[] { new File(directoryPath) });
	}

	public Directory(final Directory[] dir) {
		File[] directories = new File[dir.length];
		for (int i = 0; i < dir.length; i++) {
			directories[i] = dirToFile(dir[i]);
		}
		this.directory = directories;
	}

	public File[] getDirectory() {
		return directory;
	}

	// FIXME logic is wrong here.
	public File dirToFile(final Directory dir) {
		File directoryName = new File(dir.getDirectory().toString());
		return directoryName;
	}

	public void setDirectory(final File[] directory) {
		this.directory = directory;
	}

}
